package com.leha.forum.lehare.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;

@TableName("level")  // 对应数据库表名
public class Level {
    /**
     * 等级ID（数据库自增）
     */
    @TableId(value = "level_id", type = IdType.AUTO)
    private Integer levelId;

    /**
     * 等级名称
     */
    @TableField("level_name")
    private String levelName;

    /**
     * 用户发帖数量（数据库定义 unsigned zerofill）
     */
    @TableField("post_count")
    private Integer postCount = 0;

    /**
     * 用户回帖数量（数据库定义 unsigned zerofill）
     */
    @TableField("reply_count")
    private Integer replyCount = 0;

    /**
     * 用户精华帖数量（数据库定义 unsigned zerofill）
     */
    @TableField("essence_count")
    private Integer essenceCount = 0;

    /**
     * 最低所需经验值（数据库定义 unsigned zerofill）
     */
    @TableField("min_experience")
    private Integer minExperience;

    /**
     * 等级创建时间（自动填充）
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private Date createdAt;

    /**
     * 最后更新时间（自动填充）
     */
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private Date updatedAt;

    /**
     * 等级图标地址
     */
    private String iconUrl;

    /**
     * 等级称号
     */
    private String title;

    // 保持无参构造函数
    public Level() {
    }

    // 可选：带必要参数的构造函数
    public Level(String levelName, Integer minExperience) {
        this.levelName = levelName;
        this.minExperience = minExperience;
    }

    public String getTitle() {
        return title;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public Integer getEssenceCount() {
        return essenceCount;
    }

    public Integer getLevelId() {
        return levelId;
    }

    public Integer getMinExperience() {
        return minExperience;
    }

    public Integer getPostCount() {
        return postCount;
    }

    public Integer getReplyCount() {
        return replyCount;
    }

    public String getIconUrl() {
        return iconUrl;
    }

    public String getLevelName() {
        return levelName;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setEssenceCount(Integer essenceCount) {
        this.essenceCount = essenceCount;
    }

    public void setIconUrl(String iconUrl) {
        this.iconUrl = iconUrl;
    }

    public void setLevelId(Integer levelId) {
        this.levelId = levelId;
    }

    public void setLevelName(String levelName) {
        this.levelName = levelName;
    }

    public void setMinExperience(Integer minExperience) {
        this.minExperience = minExperience;
    }

    public void setPostCount(Integer postCount) {
        this.postCount = postCount;
    }

    public void setReplyCount(Integer replyCount) {
        this.replyCount = replyCount;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }
}